package cn.funeralobjects.asms.entity;

import cn.funeralobjects.common.annotations.CreateTime;
import cn.funeralobjects.common.annotations.Name;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Entity of SendRecord
 *
 * @author FuneralObjects
 * Create date: 2020/5/31 9:03 PM
 */
@Data
@Accessors(chain = true)
@Table(name = "t_sms_send_record")
@DynamicInsert
@DynamicUpdate
@Entity
public class ESmsSendRecord {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    private String smsSendParam;
    @Name
    private String smsSendTelephone;
    private String smsUpExtendCode;
    private String smsOutId;
    private String smsBizId;
    private String smsErrMessage;
    private String smsErrCode;
    @CreateTime
    private Date createTime;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "sms_sign_id")
    private ESmsSign sign;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "sms_template_id")
    private ESmsTemplate template;
}
